package org.lambda.map;

import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
import java.util.function.BiConsumer;

public class MapDemo {

    public static void main(String[] args) {
        Map<String, String> map = new HashMap<String, String>(3) {{
            for (int i = 0; i < 3; i++) {
                put(String.valueOf(i), String.valueOf(i));
            }
        }};

        BiConsumer<String, String> bc = (k, v) -> {
            if ("2".equalsIgnoreCase(k)) {
                System.out.println(MessageFormat.format("key:{0};value:{1}", k, v));
            }
        };
        map.forEach((k, v) -> System.out.println(k));
    }
}

